package com.zhku.goods.feignclient;


import com.zhku.base.model.RestResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserClientFactory implements FallbackFactory<UserClient> {
    @Override
    public UserClient create(Throwable throwable) {
        return new UserClient() {

            @Override
            public RestResponse<TtUser> getUser(String id) {
                log.debug("调用用户服务--查询某个用户熔断异常:{}", throwable.getMessage());
                return null;
            }
        };
    }
}
